package com.fm.financemanage.exception;




import com.fm.financemanage.exception.base.AiqaProgramBaseException;
import org.springframework.context.support.DefaultMessageSourceResolvable;
import org.springframework.validation.ObjectError;

import java.util.List;

/**
 * @version V1.0
 * @author zpc
 * @date
 */

public class ParameterException extends AiqaProgramBaseException {
    public String errorMsg;

    public ParameterException(List<ObjectError> objectErrors){
        errorMsg= objectErrors.stream().map(DefaultMessageSourceResolvable::getDefaultMessage)
                .reduce((m1,m2)->m1+":"+m2).orElse("参数缺失");
    }

}
